const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "管理员id",
      field: "id"
    },
    username: {
      type: DataTypes.CHAR(30),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "用户名",
      field: "username"
    },
    login_pwd: {
      type: DataTypes.CHAR(32),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "登录密码",
      field: "login_pwd"
    },
    login_salt: {
      type: DataTypes.CHAR(6),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "登录密码配合加密字符串",
      field: "login_salt"
    },
    mobile: {
      type: DataTypes.CHAR(11),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "手机号码",
      field: "mobile"
    },
    email: {
      type: DataTypes.CHAR(60),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "邮箱",
      field: "email"
    },
    gender: {
      type: DataTypes.INTEGER(3).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "性别（0保密，1女，2男）",
      field: "gender"
    },
    status: {
      type: DataTypes.INTEGER(3).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "状态（0正常, 1无效）",
      field: "status"
    },
    login_total: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "登录次数",
      field: "login_total"
    },
    login_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "最后登录时间",
      field: "login_time"
    },
    role_id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "所属角色组",
      field: "role_id"
    },
    add_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "添加时间",
      field: "add_time"
    },
    upd_time: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "更新时间",
      field: "upd_time"
    }
  };
  const options = {
    tableName: "sxo_admin",
    comment: "",
    indexes: []
  };
  const SxoAdminModel = sequelize.define("sxo_admin_model", attributes, options);
  return SxoAdminModel;
};